import 'package:flutter/material.dart';

class CustomCard5 extends StatelessWidget {
  const CustomCard5({Key? key, required this.imageUrl}) : super(key: key);

  final String imageUrl;

  @override
  Widget build(BuildContext context) {
    return Card(
      color: Colors.white,
      margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
      child: Container(
        padding: const EdgeInsets.all(10),
        child: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Row(
                  children: [
                    ClipRRect(
                      borderRadius: BorderRadius.circular(22),
                      child: Image.network(
                        imageUrl,
                        width: 44,
                        height: 44,
                        fit: BoxFit.fill,
                      ),
                    ),
                    Container(
                      margin: const EdgeInsets.only(left: 10),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text(
                            "Kako 熟吗旗舰店",
                            style: Theme.of(context).textTheme.headline3,
                          ),
                          Text(
                            "全场6折起",
                            style: Theme.of(context).textTheme.bodyText2,
                          )
                        ],
                      ),
                    ),
                  ],
                ),
                Container(
                  padding: const EdgeInsets.only(left: 20),
                  decoration: const BoxDecoration(
                    border: Border(
                      left: BorderSide(width: 1, color: Colors.black12),
                    ),
                  ),
                  child: Column(
                    children: [
                      Text(
                        "300",
                        style: Theme.of(context).textTheme.bodyText1,
                      ),
                      Text("宝贝", style: Theme.of(context).textTheme.bodyText2)
                    ],
                  ),
                )
              ],
            ),
            Container(
              margin: const EdgeInsets.only(top: 20),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [1, 2, 3]
                    .map(
                      (e) => Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Image.network(
                            'https://cdn.xihaf.com/template/a${e + 1}.jpg',
                            width: 90,
                            height: 90,
                            fit: BoxFit.fill,
                          ),
                          Container(
                            margin: const EdgeInsets.only(top: 10),
                            child: Row(
                              children: [
                                Text(
                                  '到手价',
                                  style: Theme.of(context).textTheme.bodyText1,
                                ),
                                Text(
                                  "￥19.0",
                                  style: Theme.of(context)
                                      .textTheme
                                      .bodyText2
                                      ?.merge(
                                          const TextStyle(color: Colors.red)),
                                )
                              ],
                            ),
                          ),
                          const Text(
                            "￥99.0",
                            style: TextStyle(
                              decoration: TextDecoration.lineThrough,
                            ),
                          )
                        ],
                      ),
                    )
                    .toList(),
              ),
            )
          ],
        ),
      ),
    );
  }
}
